package cn.itsource.hrm.to;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Document(indexName = "hrm",type = "course")
@Data
public class CourseDocTO {

    @Id
    private Long id;

    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_smart",store = true)
    private String name;

    @Field(type = FieldType.Keyword ,store = true)
    private String forUser;

    @Field(type = FieldType.Keyword ,store = true)
    private String gradeName; // 等级
    @Field(type = FieldType.Long ,store = true)
    private Long gradeId;

    @Field(type = FieldType.Long ,store = true)
    private Long courseTypeId;
    @Field(type = FieldType.Keyword ,store = true)
    private String courseTypeName; // 分类

    @Field(type = FieldType.Long ,store = true)
    private Long tenantId;

    @Field(type = FieldType.Keyword,store = true)
    private String tenantName;  // 机构

    @Field(type = FieldType.Date ,store = true)
    private Date OnLineDate;    // 上线时间

    private Date startTime;
    private Date endTime;

    private String pic;

    @Field(type = FieldType.Integer ,store = true)
    private Integer saleCount;
    @Field(type = FieldType.Integer ,store = true)
    private Integer viewCount;
    @Field(type = FieldType.Integer ,store = true)
    private Integer commentCount;

    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_smart",store = true)
    private String description; // 详情

    @Field(type = FieldType.Float ,store = true)
    private Float price;  // 现在的价格

    @Field(type = FieldType.Keyword ,store = true)
    private String isCharge; // 是否免费

    @Field(type = FieldType.Text,analyzer = "ik_smart",searchAnalyzer = "ik_smart",store = true)
    private String searchFiled;
}
